home *** CD-ROM | disk | FTP | other *** search
- // SEndScene.cpp: Implementierung der Klasse SEndScene.
- //
- //////////////////////////////////////////////////////////////////////
-
- #include "stdafx.h"
- #include "stdafx.h"
- #include "SEndScene.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char THIS_FILE[]=__FILE__;
- #define new DEBUG_NEW
- #endif
-
- #define SIZE_SPEED 0.0003f
- #define DONE_SPEED 0.0005f
- #define TEXT_SPEED 0.0005f
-
- //////////////////////////////////////////////////////////////////////
- // Konstruktion/Destruktion
- //////////////////////////////////////////////////////////////////////
-
- SEndScene::SEndScene()
- {
- state = TEXT_DONE;
- number = 0;
- size[0] = 0.15f;
- size[1] = 1.0f;
- done = false;
- position = 10.0f;
- }
-
- SEndScene::~SEndScene()
- {
-
- }
-
- void SEndScene::create(HDC hDC,int howmany)
- {
- font.createFont(hDC,"Arial",36,0.0f,SFontAttri(800,false,false));
- number = howmany;
- }
-
- void SEndScene::update(float frametime)
- {
- glDisable(GL_TEXTURE_2D);
-
- if (state == TEXT_DONE)
- {
- CString text;
-
- if (number <= 2)
- {
- text = "Super! Fast Perfekt!";
- }
- else if (number <= 4)
- {
- text = "Sehr gut!";
- }
- else if (number <= 6)
- {
- text = "Na ja geht auch besser!";
- }
- else if (number <= 8)
- {
- text = "Das Resultat ⁿberseh ich mal...";
- }
- else
- {
- text = "Pfff! Da sind ja 90-JΣhrige besser!";
- }
-
- size[0] += SIZE_SPEED*frametime;
- size[1] += DONE_SPEED*frametime;
-
- glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
-
-
- //*****************
-
- glPushMatrix();
-
- glTranslatef(0.0f,-1.5f,-8.0f);
- glScalef(size[0],size[0],1.0f);
-
- glColor3f(1.0f,1.0f,1.0f);
-
- font.drawText(CENTER,text);
-
- glPopMatrix();
-
- //***************
-
- glPushMatrix();
-
- glTranslatef(0.0f,0.0f,-8.0f);
- glScalef(size[1],size[1],1.0f);
-
- glEnable(GL_BLEND);
- glDisable(GL_DEPTH_TEST);
-
-
- glColor4f(1.0f,1.0f,1.0f,0.5f);
-
-
- font.drawText(CENTER,"Geschafft");
-
- glDisable(GL_BLEND);
- glEnable(GL_DEPTH_TEST);
-
- glPopMatrix();
-
-
- glBlendFunc(GL_ONE,GL_ONE);
-
- if (size[0] >= 3.5f)
- {
- state = TEXT_MC;
- }
- }
- else if (state == TEXT_MC)
- {
- glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
-
-
-
- //*******************************************
- //TEXT
-
- glPushMatrix();
-
- position -= TEXT_SPEED*frametime;
-
- glTranslatef(position,-0.5f,-5.0f);
- glScalef(2.0f,2.0f,1.0f);
-
- glColor3f(1.0f,1.0f,1.0f);
- font.drawText(CENTER,"MERRY CHRISTMAS!!!");
-
- glPopMatrix();
-
- //***************************
- //Schwarzfaden
-
- glPushMatrix();
-
- glTranslatef(0.0f,0.0f,-5.0f);
-
- glDisable(GL_DEPTH_TEST);
- glEnable(GL_BLEND);
-
- glBegin(GL_QUADS);
- glColor4f(0.0f,0.0f,0.0f,0.0f);
- glVertex3f(0.0f,10.0f,0.0f);
- glColor4f(0.0f,0.0f,0.0f,0.0f);
- glVertex3f(0.0f,-10.0f,0.0f);
- glColor4f(0.0f,0.0f,0.0f,1.0f);
- glVertex3f(0.0f,-10.0f,0.0f);
- glColor4f(0.0f,0.0f,0.0f,1.0f);
- glVertex3f(20.0f,-10.0f,0.0f);
- glEnd();
-
- glDisable(GL_BLEND);
- glEnable(GL_DEPTH_TEST);
-
- glBlendFunc(GL_ONE,GL_ONE);
-
- if (position < -15.0f)
- {
- done = true;
- }
-
- }
-
- glEnable(GL_TEXTURE_2D);
- }
-
- bool SEndScene::isDone()
- {
- return done;
- }
-